﻿using System.Collections.Generic;
using System.Linq;
using VideoSeller.Business.Data;

namespace VideoSeller.Business.Models
{
	public class OnlineCategorizationModel : Repository<OnlineCategorization>
	{
		 public void DeleteAll(IEnumerable<OnlineCategorization> items)
		 {
			 foreach (var item in items)
			 {
				 var oncat = Table.SingleOrDefault(x => x.Id == item.Id);

				 if (oncat != null)
				 {
					 Table.DeleteOnSubmit(oncat);
				 }
			 }

			 SubmitAllChanges();
		 }
	}
}